#include<stdio.h>

int main(void)
{
    char s1[100],s2[100];
    int i = 0, j = 0;

    gets(s1);
    gets(s2);

    do
    {
        i++;
    } while (s1[i] == s2[i]);

    printf("%d",s1[i]-s2[i]);
    
}